﻿using System.Data.Entity;

namespace File_Manager.Models
{
    public class CYTContext : DbContext
    {
        // You can add custom code to this file. Changes will not be overwritten.
        // 
        // If you want Entity Framework to drop and regenerate your database
        // automatically whenever you change your model schema, add the following
        // code to the Application_Start method in your Global.asax file.
        // Note: this will destroy and re-create your database with every model change.
        // 
        // System.Data.Entity.Database.SetInitializer(new System.Data.Entity.DropCreateDatabaseIfModelChanges<SIBI.Models.SIBIContext>());

        public CYTContext() : base("CYTConnection") { }

        public DbSet<User_I> User_I { get; set; }

        public DbSet<Turno> Turno { get; set; }

        public DbSet<Sede> Sede { get; set; }

        public DbSet<ModoPago> ModoPago { get; set; }

        public DbSet<Status> Status { get; set; }

        public DbSet<Rol> Rol { get; set; }

        public DbSet<FormaPago> FormaPago { get; set; }

        public DbSet<FormaPago02> FormaPago02 { get; set; }

        public DbSet<FormaPago03> FormaPago03 { get; set; }

        public DbSet<Mail> Mail { get; set; }

        public DbSet<Post_CYT> Post_CYT { get; set; }

        /************************************************************************************************************/
        /**********************          DECLARACIÓN DEL MODELO CRECE Y TRIUNFA MÓDULO 3        *********************/
        /************************************************************************************************************/
        /*** Tablas:                                                                                              ***/
        /***        Problemario.dbo                                                                               ***/
        /***        Problemario_User_I.dbo                                                                        ***/
        /***        Pregunta.dbo                                                                                  ***/
        /***        Respuesta.dbo                                                                                 ***/
        /***        Estado.dbo                                                                                    ***/
        /***        Materia.dbo                                                                                   ***/
        /***        Etapa.dbo                                                                                     ***/
        /***                                                                                                      ***/
        /************************************************************************************************************/

        public DbSet<Problemario> Problemario { get; set; }

        public DbSet<Problemario_User_I> Problemario_User_I { get; set; }

        public DbSet<Pregunta> Pregunta { get; set; }

        public DbSet<Respuesta> Respuesta { get; set; }

        public DbSet<Estado> Estado { get; set; }

        public DbSet<Etapa> Etapa { get; set; }
        
        public DbSet<Materia_1> Materia_1 { get; set; }

        public DbSet<Materia_2> Materia_2 { get; set; }

        public DbSet<Materia_3> Materia_3 { get; set; }


        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<User_I>().ToTable("User_I");
            modelBuilder.Entity<Turno>().ToTable("Turno");
            modelBuilder.Entity<Sede>().ToTable("Sede");
            modelBuilder.Entity<ModoPago>().ToTable("ModoPago");
            modelBuilder.Entity<Status>().ToTable("Status");
            modelBuilder.Entity<Rol>().ToTable("Rol");
            modelBuilder.Entity<FormaPago>().ToTable("FormaPago");
            modelBuilder.Entity<FormaPago02>().ToTable("FormaPago02");
            modelBuilder.Entity<FormaPago03>().ToTable("FormaPago03");
            modelBuilder.Entity<Mail>().ToTable("Mail");
            modelBuilder.Entity<Post_CYT>().ToTable("Post_CYT");

            /************************************************************************************************************/
            /**********************          DECLARACIÓN DEL MODELO CRECE Y TRIUNFA MÓDULO 3        *********************/
            /************************************************************************************************************/
            /*** Tablas:                                                                                              ***/
            /***        Problemario.dbo                                                                               ***/
            /***        Problemario_User_I.dbo                                                                        ***/
            /***        Pregunta.dbo                                                                                  ***/
            /***        Respuesta.dbo                                                                                 ***/
            /***        Estado.dbo                                                                                    ***/
            /***        Materia.dbo                                                                                   ***/
            /***        Etapa.dbo                                                                                     ***/
            /***                                                                                                      ***/
            /************************************************************************************************************/

            modelBuilder.Entity<Problemario>().ToTable("Problemario");
            modelBuilder.Entity<Problemario_User_I>().ToTable("Problemario_User_I");
            modelBuilder.Entity<Pregunta>().ToTable("Pregunta");
            modelBuilder.Entity<Respuesta>().ToTable("Respuesta");
            modelBuilder.Entity<Estado>().ToTable("Estado");
            modelBuilder.Entity<Etapa>().ToTable("Etapa");
            modelBuilder.Entity<Materia_1>().ToTable("Materia_1");
            modelBuilder.Entity<Materia_2>().ToTable("Materia_2");
            modelBuilder.Entity<Materia_3>().ToTable("Materia_3");
        }
    }
}
